class PrinttChar{
  constructor(char,num){
    this.str=char;
    this.num=num;
  }

  for1(){
    // var str="A";
    for(var i=1; i<=this.num; i++){
      var t="";
      for(var j=1; j<=i; j++){
        t=t+this.str;
      }
      console.log(t);
    }
  }

  for2(){
    // var str="A";
    for(var i=this.num; i>=1; i--){
      var t="";
      for(var j=1; j<=i; j++){
        t=t+this.str;
      }
      console.log(t);
    }

  }
}

var p1 =new PrinttChar("$",10);
p1.for1();
console.log("-----------");
p1.for2();
